<!-- 收藏详情弹窗 -->
<template>
            <a-form
                    ref="form3"
                    class="ele-form-detail"
                    :model="collectModalApp.collect"
                    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
                    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
                <a-descriptions :title="collectModalApp.title" bordered>
                                    <a-descriptions-item label="标识">
                        {{ collectModalApp.collect.Eid }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人">
                        {{ collectModalApp.collect.creatorName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="名称">
                        {{ collectModalApp.collect.name }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="商品">
                        {{ collectModalApp.collect.commodityId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="附件">
                        {{ collectModalApp.collect.attachmentsId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="购买用户">
                        {{ collectModalApp.collect.userId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="状态">
                        {{ collectModalApp.collect.status }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人ID">
                        {{ collectModalApp.collect.creatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="备注">
                        {{ collectModalApp.collect.remark }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建时间">
                        {{ collectModalApp.collect.createDatetime }}
                    </a-descriptions-item>
                                </a-descriptions>
            </a-form>
</template>

<script>
    import {defineComponent, reactive, onMounted, inject} from "vue";
    import {useRoute} from "vue-router"
    import {CollectService} from "@/views/mall/good/collect/collectService";

    export default defineComponent({
        setup() {
            const route = useRoute();
            let routeId = route.params.id;
            let collectListApp = inject('collectListApp', reactive({}));
            const collectModalApp = reactive({id: null, collect: {}, display: false});

            onMounted(() => {
                    collectModalApp.collect = {};
                if (routeId) {
                        collectModalApp.id = routeId;
                } else if (collectListApp.viewModalShowing) {
                        collectModalApp.id = collectListApp.currentId;
                        collectModalApp.display = true;
                }
                if (collectModalApp.id) {
                    getInfo(collectModalApp.id);
                }
            })

            const getInfo = (id) => {
                    CollectService.findCollect(id).then((res) => {
                            collectModalApp.collect = res.data;
                            collectModalApp.title = "查看 " + collectModalApp.collect.name;
                })
            }

            return {
                    collectModalApp,
                routeId,
                getInfo,
            }
        }
    })
</script>

<style scoped>
</style>

